{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# -*- coding = utf-8 -*-\n",
    "import requests\n",
    "headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'}\n",
    "url='https://weibo.com/a/hot/realtime'\n",
    "cookies = dict(cookies_are='Ugrow-G0=589da022062e21d675f389ce54f2eae7; login_sid_t=f9ef615807c80c57808eef84737c540d; cross_origin_proto=SSL; YF-V5-G0=8a1a69dc6ba21f1cd10b039dff0f4381; _s_tentry=-; Apache=5372351588622.184.1567344074165; SINAGLOBAL=5372351588622.184.1567344074165; ULV=1567344074183:1:1:1:5372351588622.184.1567344074165:; wb_view_log=1536*8641.25; SSOLoginState=1567344619; ALF=1598880651; SUB=_2A25wb7hcDeRhGedJ7VcT9i_NzT2IHXVTHK6UrDV8PUNbmtBeLRjMkW9NUcBtZwEMpNxyMGFtNxcaA28KEu2By-kx; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WF.lLCBfU8SFZumAJaSwlV05JpX5KzhUgL.Fo2NSo-ESo2pSo22dJLoI7HQIsHEUBtt; SUHB=0bt9yCGNXc42hI; wvr=6; YF-Page-G0=5161d669e1ac749e79d0f9c1904bc7bf|1567344659|1567344659; wb_view_log_1765261161=1536*8641.25; UOR=,,login.sina.com.cn; webim_unReadCount=%7B%22time%22%3A1567344667628%2C%22dm_pub_total%22%3A15%2C%22chat_group_client%22%3A0%2C%22allcountNum%22%3A72%2C%22msgbox%22%3A0%7D; WBStorage=f54cf4e4362237da|undefined')\n",
    "r = requests.get(url, cookies=cookies,headers = headers)\n",
    "#print(r.content)\n",
    "with open('weibo.html','wb') as f:\n",
    "    f.write(r.content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
